#ifndef CS537_1_input_H_GUARD
#define CS537_1_input_H_GUARD

static unsigned int const MAXCMDLENGTH=1000000; /* max character length of accepted command */
static unsigned int const CMDBUFFSIZE=1000; /* initial buffer for input string */
/* various illegal, but printable cars*/
static char* const ILLEGALLINECHARS="|;"; 
static char* const ILLEGALCMDCHARS ="|;&<>\\";
static char* const ILLEGALARGCHARS ="|;&<>\\";

static char* const PROMPT = "537sh $ "; 

/* 
 * Structure used for passing valid command information
 * to the fork/exec module
 * */
typedef struct cmdline_t
{
   char* cmd; /* command to run */

   /* run in background '&' present */
   int runInBackground;

   /* exit main loop after running command 
    * EOF was encountered */
   int exitAfter;

   /* Error during input
    * should disguard or ignore
    */
   unsigned int errCode;
   
   /* extra credit 
    *
    * set stdin, stdout based on '<', '>'
    * characters
    *
    * */
   char* stdout_dest; /* > */
   char* stdin_src;   /* < */

   int argc;     /* number of arguments */
   char** argv; /* string array of arguements */


} Cmdline;


/* Returns the cmdline struct above */
Cmdline* getCommand();

/* Cleans up memory used by struct */
void destroy(Cmdline* cmdl);

#endif
